import request from '@/axios'

export const getDictListApi = (params) => {
  return request.get({ url: '/system/dict/type/list', params })
}

export const saveTableApi = (data: any) => {
  return request.post({ url: '/system/dict/type', data })
}

export const updateTableApi = (data: any) => {
  return request.put({ url: '/system/dict/type', data })
}

export const deleteDictApi = (dictId: any) => {
  return request.delete({ url: '/system/dict/type/' + dictId })
}

export const getDictItemListApi = (params) => {
  return request.get({ url: '/system/dict/data/list', params })
}

export const saveDictItemApi = (data: any) => {
  return request.post({ url: '/system/dict/data', data })
}

export const updateDictItemApi = (data: any) => {
  return request.put({ url: '/system/dict/data', data })
}

export const deleteDictItemApi = (dictCode) => {
  return request.delete({ url: '/system/dict/data/' + dictCode })
}
